home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1995 June / MacFormat 25.iso / Shareware City / Developers / OutOfPhase1.1 Source / OutOfPhase Folder / SampleList.h < prev    next >
Text File  |  1994-07-22  |  6KB  |  157 lines

  1. /* SampleList.h */
  2.  
  3. #ifndef Included_SampleList_h
  4. #define Included_SampleList_h
  5.  
  6. /* SampleList module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Screen */
  12. /* EventLoop */
  13. /* Memory */
  14. /* StringList */
  15. /* Array */
  16. /* SampleObject */
  17. /* Alert */
  18. /* DataMunging */
  19. /* PcodeSystem */
  20. /* SampleConsts */
  21. /* FixedPoint */
  22. /* MainWindowStuff */
  23. /* BufferedFileInput */
  24. /* BufferedFileOutput */
  25. /* Files */
  26. /* Scrap */
  27.  
  28. #include "Screen.h"
  29. #include "EventLoop.h"
  30. #include "SampleConsts.h"
  31. #include "FixedPoint.h"
  32. #include "MainWindowStuff.h"
  33.  
  34. struct SampleListRec;
  35. typedef struct SampleListRec SampleListRec;
  36.  
  37. /* forward declarations */
  38. struct MainWindowRec;
  39. struct CodeCenterRec;
  40. struct SampleObjectRec;
  41. struct BufferedInputRec;
  42. struct BufferedOutputRec;
  43. struct FileType;
  44.  
  45. /* create a new sample list */
  46. SampleListRec*            NewSampleList(struct MainWindowRec* MainWindow,
  47.                                             struct CodeCenterRec* CodeCenter, WinType* ScreenID,
  48.                                             OrdType XLoc, OrdType YLoc, OrdType Width, OrdType Height);
  49.  
  50. /* delete the sample list and all of the samples it contains */
  51. void                                DisposeSampleList(SampleListRec* SampList);
  52.  
  53. /* change the location of the sample list in the window */
  54. void                                SetSampleListLocation(SampleListRec* SampList,
  55.                                             OrdType XLoc, OrdType YLoc, OrdType Width, OrdType Height);
  56.  
  57. /* redraw the list */
  58. void                                SampleListRedraw(SampleListRec* SampList);
  59.  
  60. /* see if the specified coordinates falls inside the sample list rectangle */
  61. MyBoolean                        SampleListHitTest(SampleListRec* SampList,
  62.                                             OrdType XLoc, OrdType YLoc);
  63.  
  64. /* handle a mouse down event for the sample list */
  65. void                                SampleListDoMouseDown(SampleListRec* SampList, OrdType XLoc,
  66.                                             OrdType YLoc, ModifierFlags Modifiers);
  67.  
  68. /* called when the window becomes active */
  69. void                                SampleListBecomeActive(SampleListRec* SampList);
  70.  
  71. /* called when the window becomes inactive */
  72. void                                SampleListBecomeInactive(SampleListRec* SampList);
  73.  
  74. /* called when a selection is made in another list, so that this list */
  75. /* is deselected */
  76. void                                SampleListDeselect(SampleListRec* SampList);
  77.  
  78. /* check to see if there is a selection in this list */
  79. MyBoolean                        SampleListIsThereSelection(SampleListRec* SampList);
  80.  
  81. /* check to see if any of the samples contained in this list need to be saved */
  82. MyBoolean                        DoesSampleListNeedToBeSaved(SampleListRec* SampList);
  83.  
  84. /* open an edit window for the selected sample */
  85. void                                SampleListOpenSelection(SampleListRec* SampList);
  86.  
  87. /* create a new sample and open a window for it */
  88. void                                SampleListNewSample(SampleListRec* SampList);
  89.  
  90. /* delete the selected sample */
  91. void                                SampleListDeleteSelection(SampleListRec* SampList);
  92.  
  93. /* delete the explicitly specified sample */
  94. void                                SampleListDeleteSample(SampleListRec* SampList,
  95.                                             struct SampleObjectRec* TheSample);
  96.  
  97. /* the name of a sample has changed, so the name in the scrolling */
  98. /* list must also be changed */
  99. void                                SampleListSampleNameChanged(SampleListRec* SampList,
  100.                                             struct SampleObjectRec* TheSample);
  101.  
  102. /* look for a specified sample.  returns NIL if not found.  the name is NOT null */
  103. /* terminated */
  104. struct SampleObjectRec*    SampleListLookupNamedSample(SampleListRec* SampList, char* Name);
  105.  
  106. /* obtain large fixedpoint data for samples.  returns the error code defined */
  107. /* in SampleConsts.  the name is NOT null terminated */
  108. SampleErrors                SampleListGetSampleLeftFixed(SampleListRec* SampList,
  109.                                             char* Name, largefixedsigned** DataOut);
  110. SampleErrors                SampleListGetSampleRightFixed(SampleListRec* SampList,
  111.                                             char* Name, largefixedsigned** DataOut);
  112. SampleErrors                SampleListGetSampleMonoFixed(SampleListRec* SampList,
  113.                                             char* Name, largefixedsigned** DataOut);
  114.  
  115. /* use the provided data to open a new sample with the specified attributes. */
  116. /* this is used when opening an algorithmic sample as a data sample. */
  117. /* RawData MUST be valid. */
  118. struct SampleObjectRec*    SampleListCopyRawSampleAndOpen(SampleListRec* SampList,
  119.                                             char* RawData, NumBitsType NumBits, NumChannelsType NumChannels,
  120.                                             long Origin, long LoopStart1, long LoopStart2, long LoopStart3,
  121.                                             long LoopEnd1, long LoopEnd2, long LoopEnd3, long SamplingRate,
  122.                                             double NaturalFrequency);
  123.  
  124. /* the document's name has changed, so the windows have to be updated */
  125. void                                SampleListGlobalNameChange(SampleListRec* SampleList,
  126.                                             char* NewFilename);
  127.  
  128. /* read sample objects from a file.  returns True if fully successful. */
  129. FileLoadingErrors        SampleListReadData(SampleListRec* SampleList,
  130.                                             struct BufferedInputRec* Input);
  131.  
  132. /* write sample objects to a file.  returns True if fully successful. */
  133. FileLoadingErrors        SampleListWriteData(SampleListRec* SampleList,
  134.                                             struct BufferedOutputRec* Output);
  135.  
  136. /* after a file has been saved, this is called to mark all objects as not modified. */
  137. void                                SampleListMarkAllObjectsSaved(SampleListRec* SampleList);
  138.  
  139. /* copy the selected object in the list to the clipboard.  return False if failed. */
  140. MyBoolean                        SampleListCopyObject(SampleListRec* SampleList);
  141.  
  142. /* try to paste the clipboard in as a sample object.  returns False if it failed */
  143. /* or the clipboard did not contain a sample object. */
  144. MyBoolean                        SampleListPasteObject(SampleListRec* SampleList);
  145.  
  146. /* paste a sample object in from the file */
  147. MyBoolean                        SampleListPasteFromFile(SampleListRec* SampleList,
  148.                                             struct FileType* File);
  149.  
  150. /* find out how many samples there are in this list */
  151. long                                SampleListHowMany(SampleListRec* SampleList);
  152.  
  153. /* get an indexed sample from the list */
  154. struct SampleObjectRec*    SampleListGetIndexedSample(SampleListRec* SampleList, long Index);
  155.  
  156. #endif
  157.